import React from 'react';
import { Link } from 'dva/router';
import classNames from 'classnames/bind'
import styles from './_layout.less';

// const classNames = require('classnames');
const cx = classNames.bind(styles);

function userLayout(props) {
  const pathname = props.location.pathname;
  const loginClassName = cx({subTitle:true, active: pathname === '/user/login'})
  const registerClassName = cx({subTitle:true, active: pathname === '/user/register'})

  const forgotContent = <div className={styles.title}>重置密码</div>;
  const otherContent =  <div className={styles.title}>
    <Link className={loginClassName} to="/user/login" >谷老师学堂</Link>
    {/*&nbsp;-&nbsp;*/}
    {/*<Link className={registerClassName} to="/user/register">注册</Link>*/}
  </div>
  return <div className={styles.main}>
    <div className={styles.form}>
      {pathname === '/user/forgot' ? forgotContent : otherContent}
      {/*<div className={styles.title}>*/}
      {/*  <Link className={loginClassName} to="/user/login" >登录</Link>*/}
      {/*   &nbsp;-&nbsp;*/}
      {/*  <Link className={registerClassName} to="/user/register">注册</Link>*/}
      {/*</div>*/}
      {props.children}
    </div>
  </div>
}
export default userLayout;
